package com.cupk.controller;

import com.cupk.pojo.Orders;
import com.cupk.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 名称OrdersController
 * 描述订单控制器
 *
 * @version 1.0
 * @author:zschun
 * @datatime:2022-06-23 23:40
 */
@RequestMapping("/orders")
@Controller
public class OrdersController {
    @Autowired(required = false)
    private OrdersService ordersService;

    @GetMapping("/findOwP")
    public String findOrdersWithProduct(Integer id, Model model){
        Orders orders=ordersService.findOrdersWithProduct(id);
        System.out.println(orders+"*********************************************************");
        model.addAttribute("msg","订单信息查询成功！！！");
        return "public/success";
    }
}
